package com.yx.changdao.common.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.yx.changdao.common.entity.Article;
import com.yx.changdao.common.entity.ProblemApply;
import com.yx.changdao.common.vo.ApplyProblemVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import com.yx.changdao.common.cache.MybatisRedisCache;
import org.apache.ibatis.annotations.CacheNamespace;

import java.sql.Wrapper;
import java.util.List;

/**
 * @Description: <br/>
 * 文章
 * <p>
 * <br/>
 * @Auther: walter
 * @create 2020/04/10 14:48
 */
@Repository
//@CacheNamespace(implementation = MybatisRedisCache.class, eviction = MybatisRedisCache.class)
public interface ArticleMapper extends BaseMapper<Article> {

    @Select("SELECT id,tite,img,article_summary,category_id,data_from,name,outline,create_time,create_by,create_by_name,update_time,update_by,update_by_name FROM article ${ew.customSqlSegment}")
    List<Article> selectArticle(@Param(Constants.WRAPPER) QueryWrapper<Article> queryWrapper);

    @Select("select id,tite,img,article_summary,category_id,data_from,name,outline,create_time,create_by,create_by_name,update_time,update_by,update_by_name from article ${ew.customSqlSegment}")
    IPage<Article> pageNex(IPage<Article> page, @Param(Constants.WRAPPER) QueryWrapper<Article> queryWrapper);
}
